home *** CD-ROM | disk | FTP | other *** search
- Path: news.iadfw.net!usenet
- From: Mark Nelson <markn@airmail.net>
- Newsgroups: comp.lang.c++
- Subject: Re: Why won't this work?
- Date: Sat, 16 Mar 1996 10:19:19 -0600
- Organization: customer of Internet America
- Message-ID: <314AEA07.B60@airmail.net>
- References: <4icjqa$km4@masala.cc.uh.edu>
- NNTP-Posting-Host: dal23-03.ppp.iadfw.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Sensarn wrote:
- >
- > struct human {
- > int age;
- > };
- >
- > void main(void) {
- > human bob;
- > asm mov ax,bob.age; /* Expression Syntax error here */
- > }
- >
- > Please help
- >
-
- While most MS-DOS/Windows compilers support some sort of in-line assembly,
- their capabilities differe greatly. You need to specify which compiler
- you are using in order to determine what it can and cannot do. For example,
- if you are using Watcom, the code shown above will never work, because
- you have to put your asm code in a function definition via pragma.
-
- I use inline assembly in one place in Greenleaf ArchiveLib, and it
- is a horrible looking mess of #ifdefs and hacks, since I'm supporting
- a whole bunch of different compilers. Ugh.
-
- Mark Nelson
- http://web2.airmail.net/markn
-